package ooday03;

public class Test {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小白",1,"白色");
        dogs[1] = new Dog("小黑",2,"黑色");
        dogs[2] = new Dog("小灰",3,"灰色");
        for(int i =0;i< dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }

        Chick[] chicks = new Chick[2];
        chicks[0] = new Chick("小黄",1,"黄色");
        chicks[1] = new Chick("大黑",3,"黑色");
        for (int i=0;i< chicks.length;i++){
            System.out.println(chicks[i].colour);
            chicks[i].drink();
        }

        Fish[] fish = new Fish[4];
        fish[0] = new Fish("小粉",2,"粉色");
        fish[1] = new Fish("大粉",4,"粉色");
        fish[2] = new Fish("小红",1,"红色");
        fish[3] = new Fish("大红",3,"红色");

        for (int i=0;i< fish.length;i++){
            System.out.println(fish[i].age);
            fish[i].swim();
        }

    }
}
